home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / ANSI / c-client / tenex2.h < prev    next >
C/C++ Source or Header  |  1994-10-03  |  7KB  |  151 lines

  1. /*
  2.  * Program:    Tenex mail routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    22 May 1990
  13.  * Last Edited:    2 October 1994
  14.  *
  15.  * Copyright 1994 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. /* Build parameters */
  37.  
  38.  
  39. /* Command bits from tenex_getflags(), must correspond to mailbox bit values */
  40.  
  41. #define fSEEN 1
  42. #define fDELETED 2
  43. #define fFLAGGED 4
  44. #define fANSWERED 8
  45. #define fOLD 16            /* moby sigh */
  46.  
  47.  
  48. /* TENEX I/O stream local data */
  49.     
  50. typedef struct tenex_local {
  51.   unsigned int inbox : 1;    /* if this is an INBOX or not */
  52.   unsigned int shouldcheck: 1;    /* if ping should do a check instead */
  53.   unsigned int mustcheck: 1;    /* if ping must do a check instead */
  54.   int fd;            /* file descriptor for I/O */
  55.   off_t filesize;        /* file size parsed */
  56.   time_t filetime;        /* last file time */
  57.   char *buf;            /* temporary buffer */
  58.   unsigned long buflen;        /* current size of temporary buffer */
  59.   unsigned long hdrmsgno;    /* message number of last header */
  60.   char *hdr;            /* last header read */
  61.   unsigned long txtmsgno;    /* message number of last text */
  62.   char *txt;            /* last text read */
  63. } TENEXLOCAL;
  64.  
  65.  
  66. /* Convenient access to local data */
  67.  
  68. #define LOCAL ((TENEXLOCAL *) stream->local)
  69.  
  70. /* Function prototypes */
  71.  
  72. DRIVER *tenex_valid (char *name);
  73. int tenex_isvalid (char *name,char *tmp);
  74. void *tenex_parameters (long function,void *value);
  75. void tenex_find (MAILSTREAM *stream,char *pat);
  76. void tenex_find_bboards (MAILSTREAM *stream,char *pat);
  77. void tenex_find_all (MAILSTREAM *stream,char *pat);
  78. void tenex_find_all_bboards (MAILSTREAM *stream,char *pat);
  79. long tenex_subscribe (MAILSTREAM *stream,char *mailbox);
  80. long tenex_unsubscribe (MAILSTREAM *stream,char *mailbox);
  81. long tenex_subscribe_bboard (MAILSTREAM *stream,char *mailbox);
  82. long tenex_unsubscribe_bboard (MAILSTREAM *stream,char *mailbox);
  83. long tenex_create (MAILSTREAM *stream,char *mailbox);
  84. long tenex_delete (MAILSTREAM *stream,char *mailbox);
  85. long tenex_rename (MAILSTREAM *stream,char *old,char *new);
  86. MAILSTREAM *tenex_open (MAILSTREAM *stream);
  87. void tenex_close (MAILSTREAM *stream);
  88. void tenex_fetchfast (MAILSTREAM *stream,char *sequence);
  89. void tenex_fetchflags (MAILSTREAM *stream,char *sequence);
  90. ENVELOPE *tenex_fetchstructure (MAILSTREAM *stream,long msgno,BODY **body);
  91. char *tenex_fetchheader (MAILSTREAM *stream,long msgno);
  92. char *tenex_fetchheader_work (MAILSTREAM *stream,long m,unsigned long *siz);
  93. char *tenex_fetchtext (MAILSTREAM *stream,long msgno);
  94. char *tenex_fetchtext_work (MAILSTREAM *stream,long m,unsigned long *siz);
  95. char *tenex_fetchbody (MAILSTREAM *stream,long m,char *sec,unsigned long *len);
  96. unsigned long tenex_header (MAILSTREAM *stream,long msgno,unsigned long *size);
  97. void tenex_setflag (MAILSTREAM *stream,char *sequence,char *flag);
  98. void tenex_clearflag (MAILSTREAM *stream,char *sequence,char *flag);
  99. void tenex_search (MAILSTREAM *stream,char *criteria);
  100. long tenex_ping (MAILSTREAM *stream);
  101. void tenex_check (MAILSTREAM *stream);
  102. void tenex_snarf (MAILSTREAM *stream);
  103. void tenex_expunge (MAILSTREAM *stream);
  104. long tenex_copy (MAILSTREAM *stream,char *sequence,char *mailbox);
  105. long tenex_move (MAILSTREAM *stream,char *sequence,char *mailbox);
  106. long tenex_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
  107.            STRING *message);
  108. void tenex_gc (MAILSTREAM *stream,long gcflags);
  109.  
  110. int tenex_lock (int fd,char *lock,int op);
  111. void tenex_unlock (int fd,char *lock);
  112. unsigned long tenex_size (MAILSTREAM *stream,long m);
  113. unsigned long tenex_822size (MAILSTREAM *stream,long msgno);
  114. char *tenex_file (char *dst,char *name);
  115. long tenex_getflags (MAILSTREAM *stream,char *flag,unsigned long *uf);
  116. long tenex_parse (MAILSTREAM *stream);
  117. long tenex_copy_messages (MAILSTREAM *stream,char *mailbox);
  118. MESSAGECACHE *tenex_elt (MAILSTREAM *stream,long msgno);
  119. void tenex_update_status (MAILSTREAM *stream,long msgno,long syncflag);
  120. char tenex_search_all (MAILSTREAM *stream,long msgno,char *d,long n);
  121. char tenex_search_answered (MAILSTREAM *stream,long msgno,char *d,long n);
  122. char tenex_search_deleted (MAILSTREAM *stream,long msgno,char *d,long n);
  123. char tenex_search_flagged (MAILSTREAM *stream,long msgno,char *d,long n);
  124. char tenex_search_keyword (MAILSTREAM *stream,long msgno,char *d,long n);
  125. char tenex_search_new (MAILSTREAM *stream,long msgno,char *d,long n);
  126. char tenex_search_old (MAILSTREAM *stream,long msgno,char *d,long n);
  127. char tenex_search_recent (MAILSTREAM *stream,long msgno,char *d,long n);
  128. char tenex_search_seen (MAILSTREAM *stream,long msgno,char *d,long n);
  129. char tenex_search_unanswered (MAILSTREAM *stream,long msgno,char *d,long n);
  130. char tenex_search_undeleted (MAILSTREAM *stream,long msgno,char *d,long n);
  131. char tenex_search_unflagged (MAILSTREAM *stream,long msgno,char *d,long n);
  132. char tenex_search_unkeyword (MAILSTREAM *stream,long msgno,char *d,long n);
  133. char tenex_search_unseen (MAILSTREAM *stream,long msgno,char *d,long n);
  134. char tenex_search_before (MAILSTREAM *stream,long msgno,char *d,long n);
  135. char tenex_search_on (MAILSTREAM *stream,long msgno,char *d,long n);
  136. char tenex_search_since (MAILSTREAM *stream,long msgno,char *d,long n);
  137. char tenex_search_body (MAILSTREAM *stream,long msgno,char *d,long n);
  138. char tenex_search_subject (MAILSTREAM *stream,long msgno,char *d,long n);
  139. char tenex_search_text (MAILSTREAM *stream,long msgno,char *d,long n);
  140. char tenex_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
  141. char tenex_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
  142. char tenex_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
  143. char tenex_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
  144.  
  145. typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
  146. search_t tenex_search_date (search_t f,long *n);
  147. search_t tenex_search_flag (search_t f,long *n,MAILSTREAM *stream);
  148. search_t tenex_search_string (search_t f,char **d,long *n);
  149.  
  150. char *bezerk_snarf (MAILSTREAM *stream,long msgno,long *size);
  151.